<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <!-- 这段js代码需要最先执行，不能采用引入方式 -->
    <script>
        document.querySelector('html').style.fontSize = window.screen.width / 20 + 'px'
        window.onresize = function () {
            document.querySelector('html').style.fontSize = window.screen.width / 20 + 'px'
        }
    </script>
</head>

<body>

</body>

</html>